package com.zmn.oms.third.gomegj.service;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.work.OrderWork;
import com.zmn.oms.model.entity.work.OrderWorkLogChange;
import com.zmn.oms.third.gomegj.dto.GmgjRequestDTO;

/**
 * 类描述：与国美管家的对接接口
 *
 * @author XieWenBing
 * @date 2020/11/04 16:00
 */
public interface GmgjService {

    /**
     * 处理国美管家发送的订单消息（创建订单，取消订单，订单支付等）
     *
     * @param gmgjRequestDTO
     * @throws OmsBaseException
     */
    void handleOrderMsg(GmgjRequestDTO gmgjRequestDTO) throws OmsBaseException;

    /**
     * 同步渠道修改订单预约
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDutytime(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步渠道取消订单
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncCancelOrder(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步渠道订单派单
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDistribute(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步渠道订单完成
     *
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderComplete(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单明细
     * @param accessToken
     * @param orderWork
     * @return
     * @throws OmsBaseException
     */
    boolean syncOrderServiceItem(String accessToken, OrderWork orderWork) throws OmsBaseException;

    /**
     * 获取订单列表
     */
    void getOrderList() throws OmsBaseException;


    /**
     * 读取redis或通过http获得通信token
     * @return
     */
    public String getAccessToken();

    /**
     * 根据渠道订单id创建订单
     *
     * @param channelOrderId
     * @throws OmsBaseException
     */
    void createOrderByChannelOrderId(String channelOrderId) throws OmsBaseException;

    /**
     * 获取支付链接
     * @param orderId
     * @return
     */
    String getPayUrl(Long orderId,Long workId) throws OmsBaseException;
}
